<template>
	<view>
		<view v-if="res.status == 0" style="padding-top: 40upx;">
			<image src="../../../static/information.png" mode="" style="width: 160upx;height: 160upx;margin: 40upx auto;display: block;"></image>
			<view style="font-size: 32upx;color: #999;text-align: center;" v-cloak>{{res.result.message}}</view>
			<view style="padding: 40upx;">
				<button type="warn" @click="wanshan">前去完善</button>
			</view>
		</view>
		<view v-else style="padding-top: 20upx;">
			<view class="webkit" style="background: #fff;padding: 0 24upx;">
				<view style="line-height: 96upx;height: 96upx;margin-right: 30upx;">手机号</view>
				<input class="flex" style="position: relative;line-height: 96upx;height: 96upx;" type="text" value="" placeholder="请输入您要转账的手机号" @input='mobileInput' @blur='mobileInput' />
			</view>
			<view class="box" style="padding: 24upx;">
				<button type="warn" @click="next">下一步</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				res:[],
				openid:"",
				result:'',
				mobile:''
			};
		},
		onLoad:function(){
			uni.showLoading()
			this.setAjax()
		},
		methods:{
			setAjax(){
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member.hyhz&app=1',
					method: 'POST',
					data:{
						'openid':this.openid
					},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						console.log(res)
						uni.hideLoading()
						this.res = res.data
						if(res.data.result.error){
							this.result = res.data.result.error
						}
					},
					fail: () => {},
					complete: () => {}
				});
				},
				fail: () => {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			});
			},
			wanshan(){
				uni.navigateTo({
					url: '../paypwd/paypwd'
				});
			},
			mobileInput(e){
				this.mobile = e.target.value
			},
			next(){
				if(this.mobile == ""){
					uni.showToast({
						title: '请输入11位手机号',
						icon:"none"
					});
				}else{
					uni.request({
						url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member.hyhz.member&app=1',
						method: 'POST',
						data:{
							'openid':this.openid,
							'mobile':this.mobile
						},
						header:{'Content-Type':'application/x-www-form-urlencoded'},
						success: res => {
							uni.navigateTo({
								url: 'zzks/zzks?mobile='+this.mobile
							});
						},
						fail: () => {},
						complete: () => {}
					});
				}
			}
		}
	}
</script>

<style>

</style>
